<script type="text/javascript">
var i = 0;
    $(document).ready(function() {
        $('#findtour').click(function(){
        	var baseURL ="/tour/tour/country/<?php echo $this->country; ?>/theme/";
    		var str="";
    		$('#thematictour input').each(function(){
    			if ($(this).is(":checked"))
    				str += $(this).val() + "_";
    		});
    		baseURL +=str;
    		window.location=baseURL;
        });

        $('.frame-img .back').hide().css('left', 0);
        
        function mySideChange(front) {
            if (front) {
    			if (i==0)
    			{
    				$(this).parent().find('div.front').show();
    				$(this).parent().find('div.back').hide();
    			}
                
            } else {
    			
                $(this).parent().find('div.front').hide();
                $(this).parent().find('div.back').show();
            }
        }
        
        $('.frame-img').hover(
            function () {
                $(this).find('div').stop().rotate3Di('flip', 300, {direction: 'clockwise', sideChange: mySideChange});
            },
            function () {
    		if ( i==0)
    		{
    			 $(this).find('div').stop().rotate3Di('unflip', 300, {sideChange: mySideChange});
    		}
            }
        );
    	$('.check_box').click(function () {
    		if ($(this).is(':checked')  )
    		{
    		  i++;
    		}
    		else {
    			i--;
    		}
    	});
    });
</script>
<div >
	
	<div class="frame-img" >
		<div class="front" >
			<a href="<?php echo $this->url(array('country' => 'vietnam','tourtype' => 'sorttour'), 'tourlist') ?>" >
				<span>Half day to 4 days daily tours</span>
				<img  src="<?php echo $this->baseUrl();?>/images/default/1_half.jpg" />
			</a>
		</div>
		<div class="back" >
			<a href="<?php echo $this->url(array('country' => 'vietnam','tourtype' => 'sorttour'), 'tourlist') ?>" >Half day to 4 days daily tours</a>
		</div>
	</div>
	
	<div class="frame-img" >
		<div class="front" >
			<a href="<?php echo $this->url(array('country' => 'vietnam','tourtype' => 'packagetour'), 'tourlist') ?>" >
				<span >Package tours</span>
				<img src="<?php echo $this->baseUrl();?>/images/default/1_package.jpg"  />
			</a>
		</div>
		<div class="back" >
			<a href="<?php echo $this->url(array('country' => 'vietnam','tourtype' => 'sorttour'), 'tourlist') ?>" >Package tours</a>
		</div>
	</div>
	
	<div class="small frame-img " >
		<div class="front" >
			<a><span >thematic tours</span><img src="<?php echo $this->baseUrl();?>/images/default/1_theme.jpg"/></a>
		</div>
		<div id="thematictour" class="back" >
			thematic tours
			<?php $i=0; foreach ($this->theme as $theme): ?>
					<input value="<?php echo $this->escape($theme->id); ?>" type="checkbox" /><label><?php echo substr($this->escape($theme->name_en),0,20); if(strlen($this->escape($theme->name_en))>30) echo("..."); ?></label>
				<br/>
			<?php $i++; endforeach; ?>
				<input id="findtour" type="button" value="Find Tours" />
		</div>
	</div>
	
	<div class=" small frame-img" >
		<div class="front" >
			<a  href="/default/hotel/index/country/<?php echo $this->country;?>" >
					<span>Hotels and Resorts</span>
					<img src="<?php echo $this->baseUrl();?>/images/default/1_hotel.jpg" />
			</a>
		</div>
		<div class="back" ><a  href="/default/hotel/index/country/<?php echo $this->country;?>" >Hotels and Resorts</a></div>
	</div>
	
	<div class=" small frame-img" >
		<div class="front" >
			<a href="/default/countryguide/index/country/<?php echo $this->country;?>" >
				<span >Country Guide</span>
				<img src="<?php echo $this->baseUrl();?>/images/default/1_country.jpg" />
			</a>
		</div>
		
		<div class="back" ><a href="/default/countryguide/index/country/<?php echo $this->country;?>" >Country Guide</a></div>
	</div>
	
</div>